/*
 * Copyright (C) 2010 Fred Bojin Liu.
 *
 * Licensed under the GPL, Version 2.0;
 * you may not use this file except in compliance with the License.
 * A copy of the license is included (see the "LICENSE.txt")
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package edu.ucdavis.fredliu.speedtracker;

import java.util.ArrayList;

import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class CarItemizedOverlay extends ItemizedOverlay<OverlayItem> {
	ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
	
	public CarItemizedOverlay(Drawable defaultMarker) {
		super(boundCenterBottom(defaultMarker));
	}
	public void addItem(OverlayItem item){
		items.add(item);
		populate();
	}
	public void removeOldItems(){
		items.removeAll(items);
		
	}
	@Override
	protected OverlayItem createItem(int i) {
		return items.get(i);
	}

	@Override
	public int size() {
		return items.size();
	}

}
